#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>



int main(void)
{
    int fd, size;
    char buf1[] = "abcdefghij";
    char buf2[] = "ABCDEFGHIJ";
    
    if ((fd = creat("file.hole", S_IRUSR | S_IWUSR)) < 0)
    {
        printf("creat error\n");
        return -1;
    }

    size = sizeof buf1 - 1;
    if (write(fd, buf1, size) != size)
    {
        printf("buf1 write error\n");
        return -1;
    }

    if (lseek(fd, 16384, SEEK_SET) == -1)
    {
        printf("lseek error\n");
        return -1;
    } else {
        printf("success\n");
    }

    size = sizeof buf2 - 1;
    if (write(fd, buf2, size) != size)
    {
        printf("buf2 write error\n");
        return -1;
    }

    return 0;
}